package moriarty.gwt.client;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

public class SubmissionDialog extends Composite{
	
	private DialogBox dialogBox;
	private Button closeButton;
	private HTML textToServerHTML;
	private HTML serverResponseLabel;
	
	public SubmissionDialog(){
		// Create the popup dialog box
		dialogBox = new DialogBox();
		dialogBox.setText("SOTD Bot Server");
		dialogBox.setAnimationEnabled(true);
		closeButton = new Button("Close");
		
		// We can set the id of a widget by accessing its Element
		closeButton.getElement().setId("closeButton");
		textToServerHTML = new HTML();
		serverResponseLabel = new HTML();
		VerticalPanel dialogVPanel = new VerticalPanel();
		dialogVPanel.addStyleName("dialogVPanel");
		dialogVPanel.add(new HTML("<b>Sent the following submission to the SOTD Bot:</b>"));
		dialogVPanel.add(textToServerHTML);
		dialogVPanel.add(new HTML("<br><b>SOTD Bot replies:</b>"));
		dialogVPanel.add(serverResponseLabel);
		dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
		dialogVPanel.add(closeButton);
		dialogBox.setWidget(dialogVPanel);
	}

	public DialogBox getDialogBox() {
		return dialogBox;
	}

	public Button getCloseButton() {
		return closeButton;
	}

	public HTML getTextToServerHTML() {
		return textToServerHTML;
	}

	public HTML getServerResponseLabel() {
		return serverResponseLabel;
	}
	
}
